<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NVTX C API Reference: String Registration</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">NVTX C API Reference<span id="projectnumber">&#160;v3</span>
   </div>
   <div id="projectbrief">NVIDIA Tools Extension Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">String Registration</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="memitem:gaed4907d1c69789ca32d59788a6386a1f" id="r_gaed4907d1c69789ca32d59788a6386a1f"><td class="memItemLeft" align="right" valign="top">NVTX_DECLSPEC nvtxStringHandle_t NVTX_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_r_i_n_g___r_e_g_i_s_t_r_a_t_i_o_n.html#gaed4907d1c69789ca32d59788a6386a1f">nvtxDomainRegisterStringA</a> (nvtxDomainHandle_t domain, const char *string)</td></tr>
<tr class="memdesc:gaed4907d1c69789ca32d59788a6386a1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a string.  <br /></td></tr>
<tr class="separator:gaed4907d1c69789ca32d59788a6386a1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf094f0666fb38a7e4865c3c006ed27d5" id="r_gaf094f0666fb38a7e4865c3c006ed27d5"><td class="memItemLeft" align="right" valign="top"><a id="gaf094f0666fb38a7e4865c3c006ed27d5" name="gaf094f0666fb38a7e4865c3c006ed27d5"></a>
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API&#160;</td><td class="memItemRight" valign="bottom"><b>nvtxDomainRegisterStringW</b> (nvtxDomainHandle_t domain, const wchar_t *string)</td></tr>
<tr class="separator:gaf094f0666fb38a7e4865c3c006ed27d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Registered strings are intended to increase performance by lowering instrumentation overhead. String may be registered once and the handle may be passed in place of a string where an the APIs may allow.</p>
<p>See <a class="el" href="group___s_t_r_i_n_g___r_e_g_i_s_t_r_a_t_i_o_n.html">String Registration</a> for more details </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaed4907d1c69789ca32d59788a6386a1f" name="gaed4907d1c69789ca32d59788a6386a1f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaed4907d1c69789ca32d59788a6386a1f">&#9670;&#160;</a></span>nvtxDomainRegisterStringA()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA </td>
          <td>(</td>
          <td class="paramtype">nvtxDomainHandle_t&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>string</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a string. </p>
<p>Registers an immutable string with NVTX. Once registered the pointer used to register the domain name can be used in nvtxEventAttributes_t <a class="el" href="structnvtx_event_attributes__v2.html#MESSAGE_FIELD">MESSAGE_FIELD</a>. This allows NVTX implementation to skip copying the contents of the message on each event invocation.</p>
<p>String registration is an optimization. It is recommended to use string registration if the string will be passed to an event many times.</p>
<p>String are not unregistered, except that by unregistering the entire domain</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">domain</td><td>- Domain handle. If NULL then the global domain is used. </td></tr>
    <tr><td class="paramname">string</td><td>- A unique pointer to a sequence of characters.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A handle representing the registered string.</dd></dl>
<dl class="section user"><dt>Example</dt><dd>Register a string: <div class="fragment"><div class="line">nvtxDomainHandle_t domain = <a class="code hl_function" href="group___d_o_m_a_i_n_s.html#ga2bbf44a48a4a46bf8900bd886524d87d">nvtxDomainCreateA</a>(<span class="stringliteral">&quot;com.nvidia.nvtx.example&quot;</span>);</div>
<div class="line">nvtxStringHandle_t message = <a class="code hl_function" href="group___s_t_r_i_n_g___r_e_g_i_s_t_r_a_t_i_o_n.html#gaed4907d1c69789ca32d59788a6386a1f">nvtxDomainRegisterStringA</a>(domain, <span class="stringliteral">&quot;registered string&quot;</span>);</div>
<div class="line">nvtxEventAttributes_t eventAttrib = {0};</div>
<div class="line">eventAttrib.version = <a class="code hl_define" href="nv_tools_ext_8h.html#a270c1573fb02bc9f15825438913a255c">NVTX_VERSION</a>;</div>
<div class="line">eventAttrib.size = <a class="code hl_define" href="nv_tools_ext_8h.html#a5d1913ca9009ed5aad3208c3fb7a5a0e">NVTX_EVENT_ATTRIB_STRUCT_SIZE</a>;</div>
<div class="line">eventAttrib.messageType = <a class="code hl_enumvalue" href="group___g_e_n_e_r_a_l.html#ggaf74d5ab5269ee3c1de7aa0059ca31c46a4dfd8514ece4f6d1b0aa350b882950ea">NVTX_MESSAGE_TYPE_REGISTERED</a>;</div>
<div class="line">eventAttrib.message.registered = message;</div>
<div class="ttc" id="agroup___d_o_m_a_i_n_s_html_ga2bbf44a48a4a46bf8900bd886524d87d"><div class="ttname"><a href="group___d_o_m_a_i_n_s.html#ga2bbf44a48a4a46bf8900bd886524d87d">nvtxDomainCreateA</a></div><div class="ttdeci">NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char *name)</div><div class="ttdoc">Register a NVTX domain.</div></div>
<div class="ttc" id="agroup___g_e_n_e_r_a_l_html_ggaf74d5ab5269ee3c1de7aa0059ca31c46a4dfd8514ece4f6d1b0aa350b882950ea"><div class="ttname"><a href="group___g_e_n_e_r_a_l.html#ggaf74d5ab5269ee3c1de7aa0059ca31c46a4dfd8514ece4f6d1b0aa350b882950ea">NVTX_MESSAGE_TYPE_REGISTERED</a></div><div class="ttdeci">@ NVTX_MESSAGE_TYPE_REGISTERED</div><div class="ttdef"><b>Definition</b> <a href="nv_tools_ext_8h_source.html#l00456">nvToolsExt.h:453</a></div></div>
<div class="ttc" id="agroup___s_t_r_i_n_g___r_e_g_i_s_t_r_a_t_i_o_n_html_gaed4907d1c69789ca32d59788a6386a1f"><div class="ttname"><a href="group___s_t_r_i_n_g___r_e_g_i_s_t_r_a_t_i_o_n.html#gaed4907d1c69789ca32d59788a6386a1f">nvtxDomainRegisterStringA</a></div><div class="ttdeci">NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA(nvtxDomainHandle_t domain, const char *string)</div><div class="ttdoc">Register a string.</div></div>
<div class="ttc" id="anv_tools_ext_8h_html_a270c1573fb02bc9f15825438913a255c"><div class="ttname"><a href="nv_tools_ext_8h.html#a270c1573fb02bc9f15825438913a255c">NVTX_VERSION</a></div><div class="ttdeci">#define NVTX_VERSION</div><div class="ttdef"><b>Definition</b> <a href="nv_tools_ext_8h_source.html#l00177">nvToolsExt.h:177</a></div></div>
<div class="ttc" id="anv_tools_ext_8h_html_a5d1913ca9009ed5aad3208c3fb7a5a0e"><div class="ttname"><a href="nv_tools_ext_8h.html#a5d1913ca9009ed5aad3208c3fb7a5a0e">NVTX_EVENT_ATTRIB_STRUCT_SIZE</a></div><div class="ttdeci">#define NVTX_EVENT_ATTRIB_STRUCT_SIZE</div><div class="ttdef"><b>Definition</b> <a href="nv_tools_ext_8h_source.html#l00396">nvToolsExt.h:396</a></div></div>
</div><!-- fragment --></dd></dl>
<dl class="section version"><dt>Version</dt><dd>NVTX_VERSION_2 </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
